<template>
  <div class="bpl1-bg">
    <div class="co-title">
      <div class="co-title-name">
        <img src="@/assets/cockpit/subdivision/approve/item3-title-text.png" alt="" />
      </div>
    </div>
    <div class="item3-content">
      <div class="item">
        <div class="title">
          <div class="bg"></div>
          <div class="text">窗口服务</div>
        </div>
        <ul>
          <li v-for="(item, index) in arr1" :key="index">
            <div class="label">{{ item.itemKey.split(':')[0] }}</div>
            <div class="process">
              <el-progress :percentage="parseFloat(item.itemKey.split(':')[1].slice(0, -1))"></el-progress>
            </div>
            <div class="right"></div>
          </li>
        </ul>
      </div>

      <div class="item">
        <div class="title">
          <div class="bg"></div>
          <div class="text">行政审批</div>
        </div>
        <ul>
          <li v-for="(item, index) in arr2" :key="index">
            <div class="label">{{ item.itemKey.split(':')[0] }}</div>
            <div class="process">
              <el-progress :percentage="parseFloat(item.itemKey.split(':')[1].slice(0, -1))"></el-progress>
            </div>
            <div class="right"></div>
          </li>
        </ul>
      </div>

      <div class="item">
        <div class="title">
          <div class="bg"></div>
          <div class="text">测绘服务</div>
        </div>
        <ul>
          <li v-for="(item, index) in arr3" :key="index">
            <div class="label">{{ item.itemKey.split(':')[0] }}</div>
            <div class="process">
              <el-progress :percentage="parseFloat(item.itemKey.split(':')[1].slice(0, -1))"></el-progress>
            </div>
            <div class="right"></div>
          </li>
        </ul>
      </div>

      <div class="item">
        <div class="title">
          <div class="bg"></div>
          <div class="text">技术服务</div>
        </div>
        <ul>
          <li v-for="(item, index) in arr4" :key="index">
            <div class="label">{{ item.itemKey.split(':')[0] }}</div>
            <div class="process">
              <el-progress :percentage="parseFloat(item.itemKey.split(':')[1].slice(0, -1))"></el-progress>
            </div>
            <div class="right"></div>
          </li>
        </ul>
      </div>
    </div>
  </div>
</template>

<script lang="ts">
import { Vue, Component } from 'vue-property-decorator'
import { CockpitApi } from '@/api/cockpit'
@Component({
  name: 'Item3'
})
export default class Item3 extends Vue {
  private arr1 = [
    // {
    //   label: '非常不满意',
    //   value: '0.19'
    // },
    // {
    //   label: '不满意',
    //   value: '0.06'
    // },
    // {
    //   label: '基本满意',
    //   value: '0.58'
    // },
    // {
    //   label: '满意',
    //   value: '5.18'
    // },
    // {
    //   label: '非常满意',
    //   value: '93.98'
    // }
  ]

  private arr2 = []

  private arr3 = []

  private arr4 = []

  created() {
    this.initList1()
  }
  initList1() {
    CockpitApi.getPieChartDataApi().then(res => {
      this.arr1 =
        res.data &&
        res.data.filter((q: any) => {
          return q.departName === '窗口服务'
        })
      this.arr2 =
        res.data &&
        res.data.filter((q: any) => {
          return q.departName === '行政审批'
        })
      this.arr3 =
        res.data &&
        res.data.filter((q: any) => {
          return q.departName === '勘测院'
        })
      this.arr4 =
        res.data &&
        res.data.filter((q: any) => {
          return q.departName === '信息中心'
        })
    })
  }
}
</script>
<style lang="scss" scoped>
@import '~@/styles/cockpit.scss';
.bpl1-bg {
  width: 100%;
  height: 100%;
  padding: 22px 12px 12px 16px;
  background: url('~@/assets/cockpit/subdivision/approve/item3-bg.png') no-repeat 0/ 100% 100%;
  position: relative;
  display: flex;
  flex-direction: column;

  .co-title {
    flex-shrink: 0;
  }
}
.item3-content {
  width: 98%;
  display: flex;
  justify-content: space-between;
  margin: auto;
  .item {
    width: 22%;
    .title {
      position: relative;
      width: 100%;
      height: 24px;
      line-height: 24px;
      font-size: 14px !important;
      color: #fff;
      margin-top: 16px;
      .bg {
        width: 100%;
        height: 100%;
        background: url('~@/assets/cockpit/subdivision/approve/item3-text-bg.png') no-repeat 0/ 100% 100%;
        margin-left: -16px;
      }
      .text {
        position: absolute;
        left: 2px;
        top: 0;
        width: 100%;
      }
    }
    ul {
      color: #fff;
      margin-left: 2px;
      li {
        width: 100%;
        display: flex;
        margin-top: 12px;
        .label {
          width: 80px;
          flex-shrink: 0;
        }
        .process {
          flex: 1;
        }
        .right {
          width: 0;
          flex-shrink: 0;
        }
      }
    }
  }
}
::v-deep .el-progress__text {
  width: 32px;
  color: #fff;
}
::v-deep .el-progress-bar__outer {
  background-color: #072357;
}
::v-deep .el-progress-bar__inner {
  background: linear-gradient(270deg, #00d8ff 0%, rgba(0, 216, 255, 0.15) 100%) !important;
  box-shadow: 0 0 6px #00d8ff !important;
}
</style>
